'use strict'
const CustomerType = require('../models/CustomerType')
const CustomerLevel = require('../models/CustomerLevel')
const Source = require('../models/Source')
const Manager = require('../models/Manager')

module.exports = function* commonRecord(next) {
  this.sources = yield Source.find({}).select({_id: 1, name: 1})
  this.types = yield CustomerType.find({}).select({_id: 1, name: 1})
  this.levels = yield CustomerLevel.find({}).select({_id: 1, name: 1})
  this.managers = yield Manager.find({}).select({_id: 1, username: 1})
  yield next
}